package com.xiaoxin.codesandbox.errorCode;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;

/**
 * 越权写入文件
 */
public class WriteError {
    public static void main(String[] args) throws IOException {
        String user = System.getProperty("user.dir");
        String filePath=user+File.separator+"src/main/resources/木马.bat";
        String program="java -version 2>&1";
        Files.write(Paths.get(filePath), Arrays.asList(program));
    }
}
